//
//  TupleViewController.swift
//  test_swift
//
//  Created by fangyuan ding on 2021/5/31.
//

import UIKit

class TupleViewController: UIViewController {

    override func viewDidLoad() {
        super.viewDidLoad()
      
        /// 元组
        let yz = ("a",10,"c","d")
        print(yz.0,yz.1)

         
        /// 数组
        let array : [Any] = ["a",10,"c","d"]
        print(array[0])
        
        
        /// 字典
        let dic : [String : Any] = ["name":"zhangsan","age":3,"sorce":100]
        print( dic["name"] as Any, dic["age"] as Any, dic["sorce"] as Any)
       
         
        /// 元组
        let yz2 = (name:"zhangsan",age:3,sore:100)
        print(yz2.name, yz2.age)
        
        ///基本用法
        let yuanzu = ("lisi",18,100)
        print(yuanzu)
        /// 变形用法
        let (name,age,score) = ("lisi",18,100)
        print(name,age,score)
       

        func test3() -> (name:String,age:Int,score:Double) {
            return ("zhangsan",18 ,100)
        }
     

       
    }
    



}
